import java.util.Random;

/**
 * Created by dllo on 18/4/2.
 */
public class Question02 {
    public static void main(String[] args) {
        Random random = new Random();
        int[] arr = new int[20];
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random.nextInt(20);
            System.out.print(arr[i]);
            if (i != arr.length - 1) {
                System.out.print(",");
            }
        }
        System.out.println("]");
        int a = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > 10) {
                a += 1;
            }
        }
        int[] arr1 = new int[a];
        int j = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > 10) {
                arr1[j] = arr[i];
                j++;
            }
        }
        System.out.print("[");
        for (int i = 0; i < arr1.length; i++) {
            System.out.print(arr1[i]);
            if (i != arr1.length - 1) {
                System.out.print(",");

            }
        }
        System.out.println("]");
    }
}
